package com.testing.vip14login.mapper;

import com.testing.vip14login.model.Person;
import com.testing.vip14login.model.User;
import org.apache.ibatis.annotations.*;

/**
 * @Classname UserMapper
 * @Description 类型说明
 * @Date 2023/9/28 21:43
 * @Created by 特斯汀Roy
 */
@Mapper
public interface UserMapper {

    @Select("select * from userinfo where username=#{username} and password=#{password}")
    User selectOneUserByUserPwd(String username,String password);

    @Select("select * from userinfo where username=#{username}")
    User getUserInfo(String username);

    @Insert("insert into userinfo values(0,#{nickname},#{describe},#{username},#{password})")
    int addUser(User user);

    @Update("update userinfo set nickname=#{nickname},`describe`=#{describe} where username=#{username}")
    int updateUser(User user);

    @Delete("delete from userinfo where id=#{id}")
    int deleteUser(Long id);

}
